<template>
  <div>
    <p class="img">
      <img :src="data" :onerror="defaultImg"/>
    </p>
    <!-- <span v-else>数据不匹配该显示类型</span> -->
  </div>
</template>
<script>
import imgerror from "@/assets/images/imgerror.png";
export default {
  name: "dtImg",
  props: ["data"],
  data () {
    return {
      defaultImg: 'this.src="' + imgerror + '"'
    }
  },
  mounted() {}
};
</script>
<style lang="less">
p.img {
  width: 40px;
  height: 40px;
  line-height: 40px;
  img {
    width: 40px;
    height: 40px;
    display: block;
    border-radius: 40px;
  }
}
</style>
